import { AudioManager1 } from "../manager/AudioManager1";
import { EventManager } from "../manager/EventManager";
import { UIManager } from "../manager/UIManager";
import { BUNDLE_TYPE_ENUM, EVENT_NAME_ENUM } from "../base/EnumIndex";
import LevelBase from "../LevelBase";

const { ccclass, property } = cc._decorator;

@ccclass
export default class TipUI_KB extends cc.Component {
    levelBase: LevelBase = null;

    onLoad() {
        EventManager.ins.on(EVENT_NAME_ENUM.OPEN_UI, this.openUI, this);
    }
    onDestroy() {
        EventManager.ins.off(EVENT_NAME_ENUM.OPEN_UI, this.openUI, this);
    }

    openUI(levelBase: LevelBase) {
        this.levelBase = levelBase;
    }

    clickBtnYes() {
        AudioManager1.playClick();
        UIManager.ins.close();
        EventManager.ins.emit(EVENT_NAME_ENUM.KB_GAME_START);
    }
    clickBtnNo() {
        AudioManager1.playClick();
        UIManager.ins.closeAll();
        UIManager.ins.showUI("LevelUI", BUNDLE_TYPE_ENUM.HOME);

    }
}
